/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.nts.pointsstore;

import android.app.Activity;
import android.app.AlertDialog;
import android.app.AlertDialog.Builder;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.Statement;

/**
 *
 * @author Himagirinathan
 */
public class ConnectToDB
{
 Connection conn;
 Statement stmt;
 ResultSet rs;
 Activity act;

 public ConnectToDB(Activity act)
 {
   this.act=act;
   try
   {
     Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver").newInstance();
     conn=DriverManager.getConnection("jdbc:sqlserver://192.168.1.3:1433;trustServerCertificate=true", "sa", "sa");
   }
   catch(Exception e)
   {
    AlertDialog.Builder ad=new Builder(act);
    ad.setMessage(e.toString());
    ad.show();
   }
 }
}
